# $Id$
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=gdk-pixbuf2
pkgver=2.36.9
pkgrel=1
pkgdesc="An image loading library"
arch=(i686 x86_64)
url="https://wiki.gnome.org/Projects/GdkPixbuf"
license=(LGPL2.1)
depends=(glib2 libpng libtiff libjpeg libx11 jasper shared-mime-info)
makedepends=(gtk-doc gobject-introspection git docbook-xsl meson)
install=gdk-pixbuf2.install
_commit=9cc9f903b4680d76cb0b6cdbf730f13bd440472a  # tags/2.36.9^0
source=("git+https://git.gnome.org/browse/gdk-pixbuf#commit=$_commit"
        gdk-pixbuf-query-loaders.hook)
sha256sums=('SKIP'
            '963afcfacde9fd36031d93c8aa4c94a669ab1dbe9ba0d2cf17599b7d358e54c2')

pkgver() {
  cd gdk-pixbuf
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  mkdir build
  cd gdk-pixbuf
}

build() {
  cd build
  meson --prefix=/usr --buildtype=release ../gdk-pixbuf \
    --libexecdir=/usr/lib -Denable_jasper=true -Dwith_docs=true
  ninja
}

check() {
  cd build
  # pixbuf-randomly-modified fails randomly
  mesontest || :
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
  rm -rf "$pkgdir"/usr/{lib,share}/installed-tests
  install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 ../gdk-pixbuf-query-loaders.hook
}

# vim:set et sw=2:
